home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-06-24 | 2.0 KB | 72 lines | [TEXT/MPS ] |
- // Copyright © 1994-95 by Apple Computer, Inc. All rights reserved.
- // UDrawShapes.h
-
- #ifndef __USHAPEVIEW__
- #define __USHAPEVIEW__
-
- #ifndef __UVIEW__
- #include <UView.h>
- #endif
-
- class TShape;
- class TShapeDocument;
-
- //--------------------------------------------------------------------------------------------------
- // TShapeView
- //--------------------------------------------------------------------------------------------------
- class TShapeView : public TView
- {
- MA_DECLARE_CLASS;
-
- public:
- TShapeView();
-
- void IShapeView(TShapeDocument* itsDocument, Boolean forClipboard);
-
- virtual void DoPostCreate(TDocument* itsDocument); // Override
-
- // • Size determination
- virtual void CalcMinFrame(VRect& minFrame); // Override
-
- // • Commands
- virtual void DoMenuCommand(CommandNumber aCommandNumber); // Override
- virtual void DoSetupMenus(); // Override
-
- virtual void DoMouseCommand(VPoint& theMouse,
- TToolboxEvent* event,
- CPoint hysteresis); // Override
-
- // • Screen display
- virtual void DoHighlightSelection(HLState fromHL, HLState toHL); // Override
- virtual void DoSetCursor(const VPoint& localPoint, RgnHandle cursorRegion); // Override
- virtual void Draw(const VRect& area); // Override
-
- void InvalShape(TShape* aShape);
-
- // • State transition
- void Deselect();
- void RestoreSelection();
- void SaveSelection(Boolean andInval);
-
- // • Methods only relevant for a shapeView installed in the Clipboard
- virtual Boolean ContainsClipType(ResType aType); // Override
- virtual void WriteToDeskScrap(); // Override
- void ReadFromDeskScrap();
-
- // • Misc
- inline Boolean IsDragging() { return fDragging; };
- inline void SetDragging(Boolean dragging) { fDragging = dragging; };
-
- TShapeDocument* fShapeDocument; // the associated document which owns the shapes
- CPoint fClickPt; // on Paste, this is where the top-left point of the
- // clipboard boxes go
- private:
- Boolean fDragging; // tells us whether the mouse is dragging
-
- Boolean IsMenuColor(CommandNumber aCommandNumber);
- void PickColor();
- void SelectAllShapes();
- };
-
- #endif
-